﻿define(["service/service", "service/httpService"], function (service) {
    service.factory("consumeItemService", function (httpService) {
        var methods = {
            gets: function (params) {
                return httpService.get("/admin/consumeItem/gets", params);
            },
            get: function (params) {
                return httpService.get("/admin/consumeItem/get", params);
            },
            "update": function (params) {
                return httpService.upload("/admin/consumeItem/update", params);
            },
            "add": function (params) {
                return httpService.upload("/admin/consumeItem/add", params);
            },
            "updateDisabled": function (id, isDisabled) {
                return httpService.post("/admin/consumeItem/updateDisabled", { id: id, isDisabled: isDisabled });
            },
            "getUserComsumeHiss": function (params) {
                return httpService.get("/admin/consumeItem/getUserComsumeHiss", params);
            },

            getConsumeProducts: function (params) {
                return httpService.get("/admin/consumeItem/getConsumeProducts", params);
            },
            getConsumeProduct: function (params) {
                return httpService.get("/admin/consumeItem/getConsumeProduct", params);
            },
            "updateConsumeProduct": function (params) {
                return httpService.upload("/admin/consumeItem/updateConsumeProduct", params);
            },
            "addConsumeProduct": function (params) {
                return httpService.upload("/admin/consumeItem/addConsumeProduct", params);
            },
            "updateConsumeProductStatus": function (id, status) {
                return httpService.post("/admin/consumeItem/updateConsumeProductStatus", { id: id, status: status });
            },
            "updateUserComsumeHisStatus": function (id, status) {
                return httpService.post("/admin/consumeItem/UpdateUserComsumeHisStatus", { id: id, status: status });
            }

        }
        return methods;
    });
});